package com.nuanshui.heatedloan.task.service;

import java.util.List;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.nuanshui.heatedloan.constant.TransactionManagerType;
import com.nuanshui.heatedloan.pageable.Pager;
import com.nuanshui.heatedloan.task.dal.mapper.QrtzTriggersMapper;
import com.nuanshui.heatedloan.task.facade.service.TaskService;
import com.nuanshui.heatedloan.task.facade.vo.QrtzTriggersVO;

/**
 * 任务
 * @param 
 * @author guohao
 * @date 2017年1月6日 上午11:47:35
 * @since $
 */
@Service("taskService")
@Transactional(readOnly=true,value=TransactionManagerType.TASK_TRANSACTIONMANAGER)
public class TaskServiceImpl implements TaskService,InitializingBean {
	
	
	/**
	 * 分页获取已经创建的定时任务
	 */
	@Autowired
	private QrtzTriggersMapper qrtzTriggersMapper;
	@Override
	public Pager<QrtzTriggersVO> findByPager(Pager<QrtzTriggersVO> pager) {
		   List<QrtzTriggersVO> vos =  qrtzTriggersMapper.findByPager(pager);
		   pager.setData(vos);
		   return pager;	
	}
	@Override
	public void afterPropertiesSet() throws Exception {
		
	}

}
